package two;

/**
 * @Author:DarknessShadow
 * @description:
 * @date 2020/5/12 10:36
 */
public class Singleton2 {
    private static Singleton2 singleton2 = null;

    private Singleton2() {
        System.out.println("singleton2实例化。。。。。");
    }

    public synchronized static Singleton2 getInstance() {
        if (singleton2 == null) {
            singleton2 = new Singleton2();
        }
        return singleton2;
    }

}
